﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="tabQuoteDetail.ascx.cs"
    Inherits="UserControl_tabQuoteDetail" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<script language="javascript" type="text/javascript">
    function UpdateParentsLogin() {
        tb_remove();
        window.parent.location = window.parent.location;
    }
</script>

<table id="tab11" width="100%">
    <tr>
        <td>
            <asp:TextBox ID="txtQuoteID" runat="server"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td class="style1" valign="middle">
            Inspection Fee
        </td>
        <td>
            <asp:RadioButton ID="rdInspectionFee" Checked="true" runat="server" onclick="CheckFee()"
                GroupName="Quote" />
            <asp:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" TargetControlID="txtfee" FilterType="Numbers">
            </asp:FilteredTextBoxExtender>
            <asp:TextBox ID="txtfee" runat="server" CssClass="inp-form" Enabled="false">33</asp:TextBox>
        </td>
        <td valign="top">
            Amount Quoted
        </td>
        <td>
            <asp:RadioButton ID="rdAmount" runat="server" onclick="CheckFee()" GroupName="Quote" />
            <asp:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="txtamountQuoted" FilterType="Numbers">
            </asp:FilteredTextBoxExtender>
            <asp:TextBox ID="txtamountQuoted" runat="server" CssClass="inp-form" Width="80%"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td class="style1">
            Date Quoted
        </td>
        <td class="style2">
            <asp:TextBox ID="txtdate" runat="server" CssClass="inp-form" Width="91%"></asp:TextBox>
            <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtdate"
                Enabled="True">
            </asp:CalendarExtender>
        </td>
        <td>
            <asp:Label ID="lblStatus" runat="server" Text="Status"></asp:Label>
        </td>
        <td>
            <%--<asp:DropDownList ID="drststus" runat="server" Height="22px" Width="95%">
                <asp:ListItem>Current</asp:ListItem>
            </asp:DropDownList>--%>
            <asp:DropDownList ID="drAmount" runat="server" Width="95%">
                <asp:ListItem Value="0">-- Select --</asp:ListItem>
                <asp:ListItem Value="1">Waiting for quote</asp:ListItem>
                <asp:ListItem Value="2">Quoted</asp:ListItem>
                <asp:ListItem Value="3">Quote Accepted</asp:ListItem>
                <asp:ListItem Value="4">Quote Rejected</asp:ListItem>
                <asp:ListItem Value="6">BER</asp:ListItem>
                
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <%--<td class="style1">
            Out Come
        </td>
        <td class="style2">
            <asp:DropDownList ID="cboutcome" runat="server" Height="22px" Width="95%">
                <asp:ListItem>Accepted</asp:ListItem>
            </asp:DropDownList>
        </td>--%>
        <td>
            &nbsp; Notes
        </td>
        <td colspan="3">         
            <asp:TextBox ID="txtNote" runat="server" TextMode="MultiLine" Width="97%"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td colspan="4" align="center">
            <asp:Button ID="btsave" runat="server" Height="30px" Width="57px" Text="Save" OnClick="btsave_Click" />
        </td>
    </tr>
    <tr>
        <td colspan="4" align="center" style="padding-top: 15px">
            <asp:GridView ID="grdQuote" runat="server" AutoGenerateColumns="False" CssClass="grd"
                AllowPaging="True" PageSize="6" OnPageIndexChanging="grdQuote_PageIndexChanging">
                <Columns>
                    <asp:TemplateField HeaderText="Inspection Fee">
                        <ItemTemplate>
                            <%# Eval("InspectionFee", "{0:C}")%>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Left" Wrap="True" Font-Bold="true" Width="100px"></ItemStyle>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Amount Quoted">
                        <ItemTemplate>
                            <%# Eval("AmountQuoted")%>
                        </ItemTemplate>
                        <ItemStyle Width="200px" VerticalAlign="Middle" HorizontalAlign="Center"></ItemStyle>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Date Quoted" HeaderStyle-Width="100px">
                        <ItemTemplate>
                            <%# (Convert.ToDateTime(Eval("DateQuoted")).ToString("dd/MM/yyyy"))%>
                        </ItemTemplate>
                        <HeaderStyle Width="100px"></HeaderStyle>
                        <ItemStyle HorizontalAlign="Center" Width="70px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Status" HeaderStyle-Width="170px">
                        <ItemTemplate>
                            <%# Eval("QuoteStatus") %>
                        </ItemTemplate>
                        <HeaderStyle Width="170px"></HeaderStyle>
                        <ItemStyle Width="90px" VerticalAlign="Middle" HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="OutCome" HeaderStyle-Width="50px">
                        <ItemTemplate>
                            <%-- <%# Eval("ApprovalStatus")%>--%>
                            <asp:Label ID="lboutcome" runat="server"></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle Width="50px"></HeaderStyle>
                        <ItemStyle Width="90px" VerticalAlign="Middle" HorizontalAlign="Center" />
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <HeaderStyle CssClass="grdHeader" />
                <EditRowStyle BackColor="#2461BF" />
                <AlternatingRowStyle CssClass="grdAlternateRow" />
                <PagerSettings PageButtonCount="6" />
                <RowStyle CssClass="grdRow" />
            </asp:GridView>
        </td>
    </tr>
</table>
<table>
    <tr>
        <td>
            &nbsp;
        </td>
    </tr>
</table>

<script language="javascript" type="text/javascript">
//    function textAmount() {

//        var Amount = document.getElementById("<%=txtamountQuoted.ClientID %>").value;
//        if (Amount == "") {
//            document.getElementById("<%=drAmount.ClientID %>").style.display = "none";
//            document.getElementById("<%=lblStatus.ClientID %>").style.display = "none"
//        }
//        else {
//            document.getElementById("<%=drAmount.ClientID %>").style.display = "inline";
//            document.getElementById("<%=lblStatus.ClientID %>").style.display = "inline"
//        }
//    }
    function CheckFee() {
        var rdInspectionFee = document.getElementById("<%=rdInspectionFee.ClientID %>");
        var rdAmount = document.getElementById("<%=rdAmount.ClientID %>");
        var txtfee = document.getElementById("<%=txtfee.ClientID %>");
        var txtamountQuoted = document.getElementById("<%=txtamountQuoted.ClientID %>");
        if (rdInspectionFee.checked == true) {
            txtamountQuoted.disabled = true;
            txtfee.disabled = false;
        }
        else {
            txtfee.disabled = true;
            txtamountQuoted.disabled = false;
        }
    }
</script>

